package com.dream.springmvc.filter.operators;

import lombok.Getter;

/**
 * @author panwen
 */
@Getter
public enum StringOperator {
    eq(Operators::eqOp),
    ne(Operators::neOp),
    contains(Operators::stringContainsOp),
    notContains(Operators::stringNotContainsOp),
    empty(Operators::stringEmptyOp),
    notEmpty(Operators::stringNotEmptyOp);

    private final OpFunc<String> opf;

    StringOperator(OpFunc<String> opf) {
        this.opf = opf;
    }

    public boolean selectSupport(StringOperator op) {
        return op != contains && op != notContains;
    }

}
